home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 310_02 / symbol.h < prev    next >
C/C++ Source or Header  |  1990-04-18  |  841b  |  35 lines

  1. /*
  2.     Little Smalltalk string and symbol definitions
  3. */
  4. /*
  5.     for symbols y_size = SYMBOLSIZE
  6.  
  7.     only one text copy of each symbol is kept.
  8.     A global symbol table is searched each time a new symbol is
  9.     created, and symbols with the same character representation are
  10.     given the same entry.
  11.  
  12. */
  13.  
  14. struct symbol_struct {
  15.     int    y_ref_count;
  16.     int    y_size;
  17.     char    *y_value;
  18.     } ;
  19.  
  20. typedef struct symbol_struct symbol;
  21.  
  22. extern symbol *sy_search();    /* binary search for a symbol */
  23. extern char   *w_search();    /* binary search for a word */
  24.  
  25. # define symbol_value(x) (((symbol *) x)->y_value)
  26. # define new_sym(val) ((object *) sy_search(val, 1))
  27.  
  28.  
  29. # define SYMTABMAX 500
  30.  
  31. /* SYMINITSIZE symbol entries are allocated at the start of execution,
  32. which prevents malloc from being called too many times */
  33.  
  34. # define SYMINITSIZE 60
  35.